package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

/**
 * 大攻略
 */
@Getter@Setter
public class Strategy extends BaseDomain {

    public  static final int STATE_DISABLE =  -1;//禁用
    public  static final int STATE_COMMON =  0;//普通
    public  static final int STATE_HOT =  1;//推荐

    //关联地区
    private Region place;
    //标题
    private String title;
    //副标题
    private String subTitle;
    //封面
    private String coverUrl;
    //状态
    private int state;

    public String getJsonString(){
        HashMap<Object,Object> map = new HashMap();
        map.put("id",id);
        map.put("title",title);
        map.put("subTitle",subTitle);
        map.put("state",state);
        map.put("coverUrl",coverUrl);
        if (place!=null){
            map.put("placeId",place.getId());
        }
        return JSON.toJSONString(map);
    }

}